$(function() {

	var doc = $(document),
		body = $('body'),
		topMenu = body.find(".top-menu"),
		mainContent = body.find('.content'),
		previewContainer = body.find('.preview-container'),
		preview = mainContent.find('.preview'),
		tabsHeight = mainContent.find('.tabs').height() + 1;
		sideContent = body.find('.side-content');
		sideMiddle = sideContent.find('.middle');
		fileInput = body.find(".file-input");
	
	fileInput.on('change', function () {
		doc.trigger('fileopened', fileInput[0].files[0]);
	});
	
	mainContent.css('height', body.height() - topMenu.height() - 1);
	preview.css('height', mainContent.height() - tabsHeight);
	window.onresize = function(event) {
		mainContent.css('height', body.height() - topMenu.height() - 1);
		preview.css('height', mainContent.height() - tabsHeight + 1);
		previewContainer.css('width', body.width() - sideContent.width() - 1 + 'px');
		sideContent.css('height', body.height() - topMenu.height() - 1);
		sideMiddle.css('height', sideContent.height() - 84);
	}
	
	$(window).on('beforeunload', function() {
		return 'Are you sure that you want to leave this page? (Any unsaved changes will be lost)';
	});
	
});

var seeds = {};
